ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Call A Webservice from WBIMB

Post new topic  Reply to topic Goto page 1, 2  Next
 Call A Webservice from WBIMB « View previous topic :: View next topic » 
Author Message
SABCAS
PostPosted: Thu Mar 17, 2005 9:14 am    Post subject: Call A Webservice from WBIMB Reply with quote

Acolyte

Joined: 09 Mar 2005
Posts: 60
Location: Switzerland

Hallo,
I have implemented a message flow with an HTTPRequest Node, and I send this SOAP/HTTP Message:
(0x01000010):XMLNS = (
(0x05000018): = (
(0x06000011): = '1.0'
(0x06000012): = 'UTF-8'
)
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Envelope = (
(0x07000012)xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/'
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Body = (
(0x01000000)urn:www.swisscom.ch/P3NIB.Web.Service/NewInstalledBaseV1:CreateServiceLocation = (
(0x01000000):CreateServiceLocation = (
(0x02000000): = '<NS1:ServiceLocation xmlns:NS1="urn:www.swisscom.ch/P3NIB.Web.Service/NewInstalledBaseV1"><Phone>313011048</Phone><NrWires>1</NrWires><TType>classical ADSL</TType><SpeedProfileNrAccess>335</SpeedProfileNrAccess><ContractedServices><ContractedServiceToCreate><ContrEleId>4</ContrEleId><IspId>100040</IspId><CustomerClass>1</CustomerClass><LevelOfSupport>1</LevelOfSupport><ModemOwner>1</ModemOwner><SpeedProfileNrService>001</SpeedProfileNrService><StartDate>2005-01-16T14:32:00</StartDate><VlineId>1313011048</VlineId><Zone>1</Zone></ContractedServiceToCreate></ContractedServices></NS1:ServiceLocation>'
)
This I read from my Log file, but I receive always this HTTP 500 with
Request format is invalid: text/xml; charset=utf-8.

What can be false in HTTPRequest Node, I have set the properties about to generate a default HTTP Header.
But Something it's wrong.

P.S. I used the SOAP Library IA8IV3.

Thanks in Advance for the Help
Ciao
Sabato
Back to top
View user's profile Send private message
Nizam
PostPosted: Thu Mar 17, 2005 10:01 am    Post subject: Reply with quote

Disciple

Joined: 10 Feb 2004
Posts: 160

Look at the wsdl to know if you are sending the right format.
_________________
Nyzam
IBM Cert. Solution Designer - WBIMB V5
IBM Cert. Administrator - WBIMB V5
IBM Cert. Administrator - WebSphere MQ V5.3
Back to top
View user's profile Send private message
SABCAS
PostPosted: Thu Mar 17, 2005 10:13 pm    Post subject: Call a Webservice from WBIMB Reply with quote

Acolyte

Joined: 09 Mar 2005
Posts: 60
Location: Switzerland

Hallo,
Yes I checked the WSDL and there I can see just how the Webservice methods are defined, perhaps I used to call the method "CreateServiceLocation", this Method is in Wsdl so defined:

void CreateServiceLocation(String xml);

But I don't see where in wsdl is the Format Type defined.

Could you, please indicate to me in which part of Wsdl I have to see ?

Thanks A lot for your support.
Sabato
Back to top
View user's profile Send private message
SABCAS
PostPosted: Thu Mar 17, 2005 10:33 pm    Post subject: How to call webservice from WBIMB Reply with quote

Acolyte

Joined: 09 Mar 2005
Posts: 60
Location: Switzerland

Hallo ,
I hace found where in WSDL the format type checken kann: here is

POST /NIB.WebService/NewInstalledBaseV1.asmx HTTP/1.1
Host: sbe15324.corproot.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "urn:www.swisscom.ch/P3NIB.Web.Service/NewInstalledBaseV1/CreateServiceLocation"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CreateServiceLocation xmlns="urn:www.swisscom.ch/P3NIB.Web.Service/NewInstalledBaseV1">
<xml>string</xml>
</CreateServiceLocation>
</soap:Body>
</soap:Envelope>


What I can see that the Type is Text/xml; charset="utf-8",
since It's means that my HTTPNode sends the Message with another Type format.
Is it correct ?

Thanks
Sabato
Back to top
View user's profile Send private message
Nizam
PostPosted: Fri Mar 18, 2005 7:14 am    Post subject: Reply with quote

Disciple

Joined: 10 Feb 2004
Posts: 160

SABCAS,
Check if the web services is really working. I had the same problem '500 Internal server error' and 'Server was unable to process request. --&gt; Object reference not set to an instance of an object'.
The problem was actually with the web services.
Nyzam.
_________________
Nyzam
IBM Cert. Solution Designer - WBIMB V5
IBM Cert. Administrator - WBIMB V5
IBM Cert. Administrator - WebSphere MQ V5.3
Back to top
View user's profile Send private message
JLRowe
PostPosted: Fri Mar 18, 2005 9:33 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

Trace the HTTP response from the web service request, you may get an explanation of the 500 error. For example, websphere will give you a more specific error as to while the request did not work.
Back to top
View user's profile Send private message Send e-mail
SABCAS
PostPosted: Sat Mar 19, 2005 2:04 am    Post subject: Reply with quote

Acolyte

Joined: 09 Mar 2005
Posts: 60
Location: Switzerland

Hallo ,
I test and checked that the WebService really working, I send the message and this is what I receive in HTTPResponseHeader
HTTPResponseHeader = (
(0x03000000):X-Original-HTTP-Status-Line = 'HTTP/1.1 500 Internal Server Error.'
(0x03000000):X-Original-HTTP-Status-Code = 500
(0x03000000):Connection = 'close'
(0x03000000):Date = 'Sat, 19 Mar 2005 09:57:21 GMT'
(0x03000000):Server = 'Microsoft-IIS/6.0'
(0x03000000):X-Powered-By = 'ASP.NET'
(0x03000000):X-AspNet-Version = '1.1.4322'
(0x03000000):Cache-Control = 'private'
(0x03000000):Content-Type = 'text/plain; charset=utf-8'
(0x03000000):Content-Length = '53'
)
(0x01000000):BLOB = (
(0x03000000):UnknownParserName = ''
(0x03000000):BLOB = X'5265717565737420666f726d617420697320696e76616c69643a20746578742f786d6c3b20636861727365743d7574662d382e0d0a'
)

I suppose that the input message is arrived to the WebService.
The Blob Exadecimal String means "Invalid HTTP Request Content-Type = text/xml; charset="utf-8".

Thanks a Lot for the Help.
Could you see what really wrong is ?

Ciao
Sabato
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Mar 19, 2005 4:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

have you tried using 'UTF-8' instead of 'utf-8' ?
Do not use charset use encoding!
Back to top
View user's profile Send private message Send e-mail
SABCAS
PostPosted: Wed Mar 30, 2005 12:05 am    Post subject: Reply with quote

Acolyte

Joined: 09 Mar 2005
Posts: 60
Location: Switzerland

Hallo,
I have resolved the connection with WebServices, but now I have another problem, I send this
(0x01000010):XMLNS = (
(0x01000000):XML = (
(0x05000018): = (
(0x06000011): = '1.0'
(0x06000012): = 'UTF-8'
)
)
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Envelope = (
(0x07000012)xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/'
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Body = (
(0x01000000)urn:www.swisscom.ch/P3NIB.Web.Service/NewInstalledBaseV1:CreateServiceLocation = (
(0x01000000):CreateServiceLocation = (
(0x01000000):xml = (
(0x02000000): = '<?xml version="1.0"?><ServiceLocation xmlns="urn:www.swisscom.ch/P3NIB.Web.Service/NewInstalledBaseV1/CreateServiceLocation"><Phone>313011048</Phone><NrWires>001</NrWires><TType>001</TType><SpeedProfileNrAccess>151</SpeedProfileNrAccess><ContractedServices><ContractedServiceToCreate><ContrEleId>8</ContrEleId><IspId>100040</IspId><CustomerClass>001</CustomerClass><LevelOfSupport>001</LevelOfSupport><ModemOwner>001</ModemOwner><SpeedProfileNrService>017</SpeedProfileNrService><StartDate>2005-01-16T14:32:00</StartDate><VlineId>1313011048</VlineId><Zone>001</Zone></ContractedServiceToCreate></ContractedServices></ServiceLocation>'
)
)
)


and the WebService returns this:

(0x01000000):HTTPRequestHeader = (
(0x03000000):Content-Length = '135'
(0x03000000):Content-Type = 'text/xml; charset=utf-8'
(0x03000000):SOAPAction = '"urn:www.swisscom.ch/P3NIB.Web.Service/NewInstalledBaseV1/CreateServiceLocation"'
(0x03000000):Host = 'localhost'
)
(0x01000000):HTTPResponseHeader = (
(0x03000000):X-Original-HTTP-Status-Line = 'HTTP/1.1 500 Internal Server Error.'
(0x03000000):X-Original-HTTP-Status-Code = 500
(0x03000000):Date = 'Wed, 30 Mar 2005 07:40:37 GMT'
(0x03000000):Server = 'Microsoft-IIS/6.0'
(0x03000000):X-Powered-By = 'ASP.NET'
(0x03000000):X-AspNet-Version = '1.1.4322'
(0x03000000):Cache-Control = 'private'
(0x03000000):Content-Type = 'text/xml; charset=utf-8'
(0x03000000):Content-Length = '493'
(0x03000000):Proxy-Connection = 'Close'
)
(0x01000000):BLOB = (
(0x03000000):UnknownParserName = ''
(0x03000000):BLOB = X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d38223f3e0d0a3c736f61703a456e76656c6f706520786d6c6e733a736f61703d22687474703a2f2f736368656d61732e786d6c736f61702e6f72672f736f61702f656e76656c6f70652f2220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e63652220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61223e0d0a20203c736f61703a426f64793e0d0a202020203c736f61703a4661756c743e0d0a2020202020203c6661756c74636f64653e736f61703a5365727665723c2f6661756c74636f64653e0d0a2020202020203c6661756c74737472696e673e5365727665722077617320756e61626c6520746f2070726f6365737320726571756573742e202d2d2667743b2054686520646174612061742074686520726f6f74206c6576656c20697320696e76616c69642e204c696e6520312c20706f736974696f6e20312e3c2f6661756c74737472696e673e0d0a2020202020203c64657461696c202f3e0d0a202020203c2f736f61703a4661756c743e0d0a20203c2f736f61703a426f64793e0d0a3c2f736f61703a456e76656c6f70653e'
)
)

the BLOB HexString means:

<?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>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. --&gt; The data at the root level is invalid. Line 1, position 1.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

I suppose that something it's wrong in library soap_encode_request() in IA81V3.
What is it means the Soap Fault ?

Thanks in advance for your Help.

Sabato
Back to top
View user's profile Send private message
SABCAS
PostPosted: Wed Mar 30, 2005 7:44 am    Post subject: Reply with quote

Acolyte

Joined: 09 Mar 2005
Posts: 60
Location: Switzerland

Hallo
I have resolved also the invalid data Root but now it is occurred another Problem. I send the following SOAP message to WebService:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<NS1:CreateServiceLocation xmlns:NS1="urn:www.swisscom.ch/P3NIB.Web.Service/NewInstalledBaseV1">
<xml>&lt;?xml version=&quot;1.0&quot;?&gt;&lt;ServiceLocation xmlns=&quot;urn:www.swisscom.ch/P3NIB.Web.Service/NewInstalledBaseV1/CreateServiceLocation&quot;&gt;&lt;Phone&gt;313011048&lt;/Phone&gt;&lt;NrWires&gt;001&lt;/NrWires&gt;&lt;TType&gt;001&lt;/TType&gt;&lt;SpeedProfileNrAccess&gt;151&lt;/SpeedProfileNrAccess&gt;&lt;ContractedServices&gt;&lt;ContractedServiceToCreate&gt;&lt;ContrEleId&gt;8&lt;/ContrEleId&gt;&lt;IspId&gt;100040&lt;/IspId&gt;&lt;CustomerClass&gt;001&lt;/CustomerClass&gt;&lt;LevelOfSupport&gt;001&lt;/LevelOfSupport&gt;&lt;ModemOwner&gt;001&lt;/ModemOwner&gt;&lt;SpeedProfileNrService&gt;017&lt;/SpeedProfileNrService&gt;&lt;StartDate&gt;2005-01-16T14:32:00&lt;/StartDate&gt;&lt;VlineId&gt;1313011048&lt;/VlineId&gt;&lt;Zone&gt;001&lt;/Zone&gt;&lt;/ContractedServiceToCreate&gt;&lt;/ContractedServices&gt;&lt;/ServiceLocation&gt;</xml>
</NS1:CreateServiceLocation>
</soapenv:Body>
</soapenv:Envelope>


and I receive the following response:
<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>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. --&gt;Value cannot be null.Parameter name: xml</faultstring>
<detail/>
</soap:Fault>
</soap:Body>
</soap:Envelope>

I have checked in SOAP Request but I found nothing with Parameter name = xml.
Which is the explication for this error ?

Thanks a Lot for the Help
Sabato
Back to top
View user's profile Send private message
Testo
PostPosted: Wed Mar 30, 2005 9:07 am    Post subject: some hints Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

Sabato,

if you refer to the IA81v3 samples, we have inserted the following statement just prior to the call of the "call soaplib_encode_request(InputRoot,OutputRoot,Environment,Status);"

Code:

SET OutputRoot.HTTPRequestHeader.SOAPAction = 'http://ibm.com/TestService/CheckPlafond';


this because the .NET WS we are working with, requires the SOAPAction explicited.

Another suggestion is to avoid the XML tag prior to your message and in addition, I would not put initial XML statement (version, etc etc).

IA81v3 works great with us, in particular we are working with the Example 4.

Good luck,
Andrea Tedone
IBM IT Specialist
Back to top
View user's profile Send private message Send e-mail MSN Messenger
SABCAS
PostPosted: Mon Apr 04, 2005 9:49 pm    Post subject: Reply with quote

Acolyte

Joined: 09 Mar 2005
Posts: 60
Location: Switzerland

Hallo,
It's working , I resolved also this Problem , it was into SOAP Request , if you see in the soap request the Element <xml> is without namespace, so the soap fault means I cannot read the xml, I insert the namespace like this: <NS1:xml> ..... </NS1:xml> and now it works very fine.

Thanks everybody for the support and the Help!!!

ciao
Sabato
P.S. To the next time, and next issue problem
bye bye
Back to top
View user's profile Send private message
vignesh.gopal
PostPosted: Thu Jan 26, 2006 3:20 pm    Post subject: Reply with quote

Novice

Joined: 23 Dec 2002
Posts: 24

Hi Mate,
I guess m facing a similar problem to what you have already encoutered,however all my efforts are going in vain.
Can you please advice based on the details provided below.
your inputs are highly valuable...

I am attaching my ESQL as i could not fix as yet.

DECLARE mySoapNS NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE myPayment NAMESPACE 'http://abc.com';
DECLARE myXSI NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';
DECLARE myXSD NAMESPACE 'http://www.w3.org/2001/XMLSchema';


-- Add an XML declaration to the message
SET OutputRoot.XMLNS.(XML.XmlDecl) = 'XML';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Encoding) = 'UTF-8';

-- Create the SOAP Envelope
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:"SOAP-ENV" =
'http://schemas.xmlsoap.org/soap/envelope/' ;
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:xsi =
'http://www.w3.org/2001/XMLSchema-instance' ;
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:xsd =
'http://www.w3.org/2001/XMLSchema' ;

SET OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Body.myPayment:reserve.(XML.NamespaceDecl)xmlns:payment
= 'http://abc.com';

I ran a flow with a trace.
I tested using a soap message already present and the one which my esql builds and i noticed a change in the trace...

My esql trace is below
(0x01000010):XMLNS = (
(0x05000018): = (
(0x02000000): = 'XML'
(0x06000011): = '1.0'
(0x06000012): = 'UTF-8'
)
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Envelope = (
(0x07000012)xmlns:SOAP-ENV = 'http://schemas.xmlsoap.org/soap/envelope/'
(0x07000012)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance'
(0x07000012)xmlns:xsd = 'http://www.w3.org/2001/XMLSchema'
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Body = (
(0x01000000)http://abc.com:reserve = (
(0x07000012)xmlns:payment = 'http://abc.com'


below is the trace from an already built soap message.

(0x01000010):XML = (
(0x05000018):XML = (
(0x06000011): = '1.0'
(0x06000012): = 'UTF-8'
)
(0x06000002): = '
'
(0x01000000):SOAP-ENV:Envelope = (
(0x03000000):xmlns:SOAP-ENV = 'http://schemas.xmlsoap.org/soap/envelope/'
(0x03000000):xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance'
(0x03000000):xmlns:xsd = 'http://www.w3.org/2001/XMLSchema'
(0x03000000):xmlns:payment = 'http://abc.com'
(0x02000000): = '
'
(0x01000000):SOAP-ENV:Body = (
(0x02000000): = '
'
(0x01000000):payment:reserve = (
(0x02000000): = '
Back to top
View user's profile Send private message
hbagga
PostPosted: Fri Jun 02, 2006 8:57 am    Post subject: How did initial problem go away? Reply with quote

Newbie

Joined: 02 Jun 2006
Posts: 1

Invalid server response? how did you manage to get away from this?

Thanks in adv!
Harry
_________________
H A R R Y
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jun 02, 2006 2:52 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

vignesh.gopal wrote:
Hi Mate,
I guess m facing a similar problem to what you have already encoutered,however all my efforts are going in vain.
Can you please advice based on the details provided below.
your inputs are highly valuable...

I am attaching my ESQL as i could not fix as yet.

DECLARE mySoapNS NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE myPayment NAMESPACE 'http://abc.com';
DECLARE myXSI NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';
DECLARE myXSD NAMESPACE 'http://www.w3.org/2001/XMLSchema';


-- Add an XML declaration to the message
SET OutputRoot.XMLNS.(XML.XmlDecl) = 'XML';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Encoding) = 'UTF-8';

-- Create the SOAP Envelope
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:"SOAP-ENV" =
'http://schemas.xmlsoap.org/soap/envelope/' ;
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:xsi =
'http://www.w3.org/2001/XMLSchema-instance' ;
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:xsd =
'http://www.w3.org/2001/XMLSchema' ;

SET OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Body.myPayment:reserve.(XML.NamespaceDecl)xmlns:payment
= 'http://abc.com';

What you are doing is passing the namespace declaration twice.
It is already present in the constructor:
SET OutputRoot.XMLNS.mySoapNS:Envelope VALUE = NULL;
would contruct you the tag with a null value. So be careful with the (XML.NamespaceDecl). Use one or the other but not both !

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Call A Webservice from WBIMB
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.