Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Webservice call in PB 10.5 build 4523

1,553 views
Skip to first unread message

Sam

unread,
Apr 30, 2009, 1:36:52 PM4/30/09
to
I am trying to access a Webservice build in Java and deployed on
Weblogic 10.3

When I use Proxy wizard, it gives me error "Cannot parse WSDL". Not
sure why..?

When I use same WSDL file in Soap UI, everything works fine.

I have another service, created in Java and Weblogic 8.1 and
Powerbuilder is able to access this service.

When I compare WSDL of 8.1 to 10.3, I found that 8.1 had schema within
WSDL, whereas in 10.3 it was outside.

I had tried accessing webservice using EasySoap.

My question is:
1) Do I need to use .Net as my schema is outside WSDL ..?

2) Does Powerbuilder logs parsing error during Proxy wizard..?

3) If I have HTTPS webservice, can I use Easy Soap, or I can only
use .Net..?

Appreciate your help & suggestions.

Thanks.
Sam

Sam

unread,
Apr 30, 2009, 2:53:15 PM4/30/09
to

I used .Net and I was able to call webservice successfully.

Sam

unread,
Apr 30, 2009, 4:15:15 PM4/30/09
to
> I used .Net and I was able to call webservice successfully.- Hide quoted text -
>
> - Show quoted text -

1 more bummer. Came to know now, that all other developers have
Powerbuilder 10.0.1 with Build 5502.

PB 10.0.1 doesn't have support for .Net webservice call.

So how do I call webservice in PB using EasySoap where WSDL schema is
in seperate file..?

Any PB Gurus around ...?

Jessie Cordoba // Telemed

unread,
May 13, 2009, 2:09:41 PM5/13/09
to
I proceed to consume a webservice but the result never is good atach the
explication

///The conection

SoapConnection Conn //Define SOAP connection
Long ret, ll_retval

string ReturnVal, ls_response
geoipservicesoap weatherws //Define Proxy
tns__geoip actorsearchrequest

Conn = create SoapConnection
ll_retval = conn.SetOptions('SoapLog=' + '"C:\mySoapLog99.log"')
Ret=Conn.CreateInstance(weatherws, "geoipservicesoap")
if Ret <> 0 then
Messagebox("CreateInstance", "Failed, returnvalue = "+string(ret))
else
Try
actorsearchrequest = weatherws.getgeoip(sle_1.text)
ls_response = string(actorsearchrequest.returncode) + ' ' +
actorsearchrequest.returncodedetails + ' ' + actorsearchrequest.ip + ' ' +
actorsearchrequest.countryname + ' ' + actorsearchrequest.countrycode
MessageBox('Web Service Response',ls_response)
Catch ( SoapException ex )
messagebox("soapexception", ex.text)
end try
end if
Destroy Conn

Response in log

CLOSED


REQUEST:
CLOSED
POST /geoipservice.asmx HTTP/1.1
Host: www.webservicex.net
Connection: Keep-Alive
User-Agent: EasySoap++/0.6
Content-Type: text/xml; charset="UTF-8"
SOAPAction: "http://www.webservicex.net/GetGeoIP"
Content-Length: 444

<E:Envelope
xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:s="http://www.w3.org/2001/XMLSchema-instance"
xmlns:y="http://www.w3.org/2001/XMLSchema"
E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<E:Body>
<m:GetGeoIP
xmlns:m="http://www.webservicex.net">
<IPAddress
s:type="y:string">200.75.79.38</IPAddress>
</m:GetGeoIP>
</E:Body>
</E:Envelope>


RESPONSE:
HTTP/1.0 200 OK
Date: Wed, 13 May 2009 18:04:50 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 521
X-Cache: MISS from firewall
Connection: keep-alive

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetGeoIPResponse
xmlns="http://www.webservicex.net"><GetGeoIPResult><ReturnCode>-1</ReturnCode><ReturnCodeDetails>Error
Occured.Please ensure you enter proper IP address or try again
later</ReturnCodeDetails><CountryName /><CountryCode
/></GetGeoIPResult></GetGeoIPResponse></soap:Body></soap:Envelope>Connection
Disconnected

Help me please

Sam

unread,
May 13, 2009, 4:05:52 PM5/13/09
to
Found a way to call webservice in PB 10.0.1 without using
Proxy.

We can call webservice in PB 10.0.1 using OLE Object -
Msxml2.XMLHTTP.4.0

Here we have to create input Soap Envelope and parse output
XML manually.

Here's the code snippet:
----------------------------------------------------------------
String ls_post_url
String ls_args, ls_response, ls_parse_err
String ls_response_text, ls_status_text
long ll_status_code, ll_ret
OleObject loo_xmlhttp

PBDOM_Builder pbdom_buildr
PBDOM_DOCUMENT pbdom_doc
PBDOM_Element root
PBDOM_CHARACTERDATA pbdom_chrdata[]
long l = 0
string strParseErrors[]
BOOLEAN bRetTemp = FALSE

ls_post_url =
"http://localhost:7001/exp/testwebsvc_svc/1_0/Number2Word"

ls_args = "<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:com='http://com.services'> " + &
" <soapenv:Header/> " + &
" <soapenv:Body> " + &
" <com:NumberInWord> " + &
" <InputNum>12</InputNum>" + &
" </com:NumberInWord>" + &
" </soapenv:Body> " + &
"</soapenv:Envelope>"

try
//Create an instance of our COM object
loo_xmlhttp = CREATE oleobject
loo_xmlhttp.ConnectToNewObject("Msxml2.XMLHTTP.4.0")

//Lets do a POST now, notice now we will pass a String
//in the send() call that contains the arguments in the
//format name1=value1&name2=value2&...
loo_xmlhttp.open ("POST",ls_post_url, false)
loo_xmlhttp.setRequestHeader("Content-Type", "text/xml")
loo_xmlhttp.send(ls_args)

//Get our response
ls_status_text = loo_xmlhttp.StatusText
ll_status_code = loo_xmlhttp.Status

//Check HTTP Response code for errors
//http://kbs.cs.tu-berlin.de/~jutta/ht/responses.html
if ll_status_code >= 300 then
MessageBox("POST Request Failed", "Status Code:" +
String(ll_status_code)+ "~nStatus text:" + ls_status_text)
else
//Get the response we received from the web server
ls_response_text = loo_xmlhttp.ResponseText
MessageBox("POST Request Succeeded", ls_response_text)

try
pbdom_buildr = Create PBDOM_BUILDER
pbdom_doc = pbdom_buildr.BuildFromString
(ls_response_text)
bRetTemp =
pbdom_buildr.GetParseErrors(strParseErrors)
if bRetTemp = true then
for l = 1 to UpperBound(strParseErrors)
MessageBox ("Parse Error", strParseErrors[l])
next
else
// obtain the child PBDOM_TEXT of child_1
root = pbdom_doc.GetRootElement()
//Messagebox(root.getnamespaceprefix( ), root.getName(
))
root =
root.GetChildElement("Body","S","http://schemas.xmlsoap.org/soap/envelope/")
root =
root.GetChildElement("NumberInWordResponse","ns2","http://com.services")
root = root.GetChildElement("NumberWord")
Messagebox(root.getname( ), root.gettext());

end if
catch (PBDOM_EXCEPTION pbdom_except)
MessageBox ("PBDOM_EXCEPTION",
pbdom_except.GetMessage())
end try
end if

//Done so cleanup
loo_xmlhttp.DisconnectObject()

catch (RuntimeError rte)
MessageBox("Error", "RuntimeError - " + rte.getMessage())
end try

----------------------------------------------------------------

> On Apr 30, 2:53 pm, Sam <rao.sa...@gmail.com> wrote:
> > On Apr 30, 1:36 pm, Sam <rao.sa...@gmail.com> wrote:
> >
> >
> >
> >
> >
> > > I am trying to access a Webservice build in Java and
> > > deployed on Weblogic 10.3
> >
> > > When I use Proxy wizard, it gives me error "Cannot
> > > parse WSDL". Not sure why..?
> >
> > > When I use same WSDL file in Soap UI, everything works
> fine. >
> > > I have another service, created in Java and Weblogic
> > > 8.1 and Powerbuilder is able to access this service.
> >
> > > When I compare WSDL of 8.1 to 10.3, I found that 8.1
> > > had schema within WSDL, whereas in 10.3 it was
> outside. >
> > > I had tried accessing webservice using EasySoap.
> >
> > > My question is:
> > > 1) Do I need to use .Net as my schema is outside WSDL

> .? >

Sam

unread,
May 13, 2009, 4:07:45 PM5/13/09
to
Try to call service directly and see if it works.

You can also use Soap UI tool to test web service call.

If you don't want to use Proxy, you can call webservice
using OLE Object.

See my post, I have pasted the code there.

0 new messages