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 » WSDL SOAP Request - Failure

Post new topic  Reply to topic
 WSDL SOAP Request - Failure « View previous topic :: View next topic » 
Author Message
hellobond070
PostPosted: Tue Jun 28, 2011 11:36 am    Post subject: WSDL SOAP Request - Failure Reply with quote

Centurion

Joined: 18 Nov 2009
Posts: 118

Hi,

I have a problem with calling of a web service using SOAP Request node.

I have built a message flow as below :
mqinput -> compute -> soap request -> mqoutput

Now if i take the output from compute node which is an XML file and try to use it in soap ui tool to call the web service it works fine.
But when i use it throught message broker hitting the soap requesst node it throws the below error :

Code:
      (0x01000000:Name     ):RecoverableException = (
        (0x03000000:NameValue):File     = 'F:\build\S610_P\src\WebServices\WSLibrary\ImbSOAPRequestNode.cpp' (CHARACTER)
        (0x03000000:NameValue):Line     = 1123 (INTEGER)
        (0x03000000:NameValue):Function = 'ImbSOAPRequestNode::requestData' (CHARACTER)
        (0x03000000:NameValue):Type     = 'ImbRequestTemplateNode' (CHARACTER)
        (0x03000000:NameValue):Name     = 'BWH#FCMComposite_1_2' (CHARACTER)
        (0x03000000:NameValue):Label    = 'BWH.SOAP Request' (CHARACTER)
        (0x03000000:NameValue):Catalog  = 'BIPv610' (CHARACTER)
        (0x03000000:NameValue):Severity = 3 (INTEGER)
        (0x03000000:NameValue):Number   = 3691 (INTEGER)
        (0x03000000:NameValue):Text     = 'SyncRequest HTTP Error returned' (CHARACTER)
        (0x01000000:Name     ):Insert   = (
          (0x03000000:NameValue):Type = 5 (INTEGER)
          (0x03000000:NameValue):Text = 'HTTP/1.0 401 Unauthorized' (CHARACTER)
        )
        (0x01000000:Name     ):Insert   = (
          (0x03000000:NameValue):Type = 5 (INTEGER)


I have the same WSDL used in soap UI tool and Broker toolkit.

Could you guys share your thoughts on resolution so that I could try. Thank You.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jun 28, 2011 11:51 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Talk to the provider of the service you are calling.

Here is a significantly large hint as to the problem.

Quote:
'HTTP/1.0 401 Unauthorized'
.

Consider very much the difference between you executing a gui program and the broker calling a web service.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Jun 28, 2011 11:56 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You may like to try something like:

Code:

DECLARE wsse NAMESPACE 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';

...

Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Username = _uid;
Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Password = _pwd;


_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Jun 28, 2011 12:00 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
You may like to try something like:

Code:

DECLARE wsse NAMESPACE 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';

...

Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Username = _uid;
Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Password = _pwd;



It might be tried.

It's almost certainly wrong for hellobond070's particular situation.

But it might be tried. Hey, if it succeeds, hellobond070 won't even need to learn why it succeeded.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jun 28, 2011 12:01 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lancelotlinc wrote:
You may like to try something like:

Code:

DECLARE wsse NAMESPACE 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';

...

Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Username = _uid;
Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Password = _pwd;



Do you need to evaluate the namespace with {}? I'd have expected wsse:Security to resolve.

(Given that I've never used web service security like this)
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
hellobond070
PostPosted: Tue Jun 28, 2011 1:17 pm    Post subject: Reply with quote

Centurion

Joined: 18 Nov 2009
Posts: 118

Just to update :

1. Tried using the esql code provided for authorization. It did work. May be I am doing somethign wrong.
My esql code has SET OutputRoot.XMLNSC.ns.......
and I tried adding the mentioned 3 esql statements.

2. I have contacted the vendor. Hopefully they should provide some kind of suggestion.
Back to top
View user's profile Send private message
hellobond070
PostPosted: Tue Jun 28, 2011 1:43 pm    Post subject: Reply with quote

Centurion

Joined: 18 Nov 2009
Posts: 118

I am correct my statement below...TYPO ERROR

Just to update :

1. Tried using the esql code provided for authorization. It did NOT work. May be I am doing somethign wrong.
My esql code has SET OutputRoot.XMLNSC.ns.......
and I tried adding the mentioned 3 esql statements.

2. I have contacted the vendor. Hopefully they should provide some kind of suggestion/solution
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jun 29, 2011 4:36 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

hellobond070 wrote:
I am correct my statement below...TYPO ERROR

Just to update :

1. Tried using the esql code provided for authorization. It did NOT work. May be I am doing somethign wrong.
My esql code has SET OutputRoot.XMLNSC.ns.......
and I tried adding the mentioned 3 esql statements.

2. I have contacted the vendor. Hopefully they should provide some kind of suggestion/solution


It's not going to work, until you figure out what namespace you need. The example provided shows a template of what is needed within the SOAP envelope.

I suppose mqjeff is correct by inferring that people need to think about things to arrive at a logical conclusion rather than just copy & paste blindly.

Go through the documentation and discover what namespace you need, then adjust the sample code accordingly.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Wed Jun 29, 2011 4:40 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Vitor wrote:
lancelotlinc wrote:
You may like to try something like:

Code:

DECLARE wsse NAMESPACE 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';

...

Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Username = _uid;
Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Password = _pwd;



Do you need to evaluate the namespace with {}? I'd have expected wsse:Security to resolve.

(Given that I've never used web service security like this)


The code works for me in my application. I have not tried it without the squiggly braces. Next time I break into that part of the source code, I'll remove the braces and see if the code still works, then let you know.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Wed Jun 29, 2011 4:44 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

mqjeff wrote:
lancelotlinc wrote:
You may like to try something like:

Code:

DECLARE wsse NAMESPACE 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';

...

Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Username = _uid;
Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Password = _pwd;



It might be tried.

It's almost certainly wrong for hellobond070's particular situation.

But it might be tried. Hey, if it succeeds, hellobond070 won't even need to learn why it succeeded.


How I arrived at this solution was, I put a trace node before and after my compute node. From soapUI, I captured a request and reply message that worked. I fed the soapUI sample message into a SOAPInput node connected to Trace connected to compute node. I then compared the trace outputs to the soapUI outputs and kept chipping away at ESQL code till I made my trace outputs match identically to the soapUI outputs. Waaa-laaa!@ My application now connects successfully to the target Web Service.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Jun 29, 2011 4:45 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
I suppose mqjeff is correct by inferring that people need to think about things to arrive at a logical conclusion rather than just copy & paste blindly.


My point was broader, that there's not actually any particular evidence that the service being called is using WS-Security at all.

It could be using HTTP Basic Authentication, or otherwise an HTTP level security token rather than a WebServices level token.

Also, of course, the minor problem that hellobond070 doesn't even know what values to specify in the local variables _uid and _pwd.
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Wed Jun 29, 2011 5:23 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

Vitor wrote:
lancelotlinc wrote:
You may like to try something like:

Code:

DECLARE wsse NAMESPACE 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';

...

Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Username = _uid;
Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Password = _pwd;



Do you need to evaluate the namespace with {}? I'd have expected wsse:Security to resolve.

(Given that I've never used web service security like this)


The {} characters are not needed.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jun 29, 2011 5:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

joebuckeye wrote:
Vitor wrote:
lancelotlinc wrote:
You may like to try something like:

Code:

DECLARE wsse NAMESPACE 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';

...

Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Username = _uid;
Set OutputRoot.SOAP.Header.{wsse}:Security.{wsse}:UsernameToken.{wsse}:Password = _pwd;



Do you need to evaluate the namespace with {}? I'd have expected wsse:Security to resolve.

(Given that I've never used web service security like this)


The {} characters are not needed.


Didn't think so. You don't for other namespaces.

Thank you.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
hellobond070
PostPosted: Wed Jun 29, 2011 1:30 pm    Post subject: Reply with quote

Centurion

Joined: 18 Nov 2009
Posts: 118

I got a Http URL from the vendor for the same service. Surprisingly this works well through a browser. The URL has username/password. Then I try the same through broker(HTTP REQUEST NODE) setting username/password usign the below esql.

SET OutputRoot.HTTPRequestHeader."Authorization" = 'Basic '||b64Encode(CAST('XXXX'||':'||'XXXX' as BLOB CCSID 1208));

CREATE PROCEDURE b64Encode(IN source BLOB)
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "com.ibm.broker.javacompute.Base64.encode";

With the HTTP request node and i get the below error :

Code:
HTTP/1.0 401 Unauthorized
WWW-Authenticate: Basic realm="FW-1.      Reason: no user      Server "
Content-Type: text/html
Content-Length: 165

<TITLE>Error</TITLE>
<BODY>
<H1>Error 401</H1>

FW-1 at it4m7fwa: Unauthorized to access the document.<BR><BR><LI>Authorization is needed for FW-1.<BR><BR>
</BODY>
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jun 30, 2011 1:22 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If you're using Broker v7.0, you can use the UUENCODE ESQL routine instead of calling to a java procedure.

Did the vendor *specifically* tell you that you needed to supply HTTP Basic Authentication tokens? Because that's what your code does.

You need to ASK them what security credential you need to supply.

Or you need to do something like use the TCP/IP Monitor in Toolkit or wireshark or nettool or etc. etc. to create a proxy that will let you see what your Browser sends that works.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » WSDL SOAP Request - Failure
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.