当前位置: 代码迷 >> PB >> 怎样修改pb中web service代理对象的地址,解决办法
  详细解决方案

怎样修改pb中web service代理对象的地址,解决办法

热度:142   发布时间:2016-04-29 09:36:59.0
怎样修改pb中web service代理对象的地址,急!!!!!!!!!
怎样修改pb中web service代理对象的地址因为里面的web服务地址是在创建对像时就定义好了而且是protect类型,不能修改,怎么样才改?

------解决方案--------------------

SoapConnection conn // Define SoapConnection

 syb_currencyexchangeport proxy_obj // Declare proxy

 long rVal

 real amount

 

 //Define endpoint. You can omit it, if you want to use

 //the default endpoint inside proxystring str_endpoint

 

 str_endpoint = "http://services.xmethods.net:80/soap"

 conn = create SoapConnection //Instantiated connection

 

 conn.SetOptions("SoapLog=~"C:\mySoapLog.log~"") 

 // Set trace file to record soap interchange data, 

 // if string is "", disables the feature

 

 rVal = Conn.CreateInstance(proxy_obj, &

"syb_currencyexchangeport", str_endpoint)

 

 // Create proxy object

 try

 

amount = proxy_obj.getrate("us","japan") 

// Invoke service

messagebox("Current Exchange Rate", "One US Dollar"&

+ " is equal to " + string(amount) + " Japanese Yen")

 catch ( SoapException e )

messagebox ("Error", "Cannot invoke Web service")

// error handling

 end try

 destroy conn
  相关解决方案