Author |
Message
|
smdavies99 |
Posted: Fri Jan 15, 2010 9:21 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
So what does the detailed output from a user trace show when the Create .. PARSE statement is executed?
You have done this right? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
broker_new |
Posted: Fri Jan 15, 2010 9:27 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
( BROKER611.default ) Error message ''=============================================================================
2010-01-15 12:26:34.836279
( ['WSRoot' : 0x7918ee0]
(0x01000000:Name):Properties = ( ['WSPROPERTYPARSER' : 0x41024a0]
(0x03000000:NameValue):MessageSet = '' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
(0x03000000:NameValue):Encoding = 546 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 1208 (INTEGER)
(0x03000000:NameValue):Transactional = FALSE (BOOLEAN)
(0x03000000:NameValue):Persistence = FALSE (BOOLEAN)
(0x03000000:NameValue):CreationTime = GMTTIMESTAMP '2010-01-15 17:26:33.076' (GMTTIMESTAMP)
(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):ReplyProtocol = 'SOAP-HTTP' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = 'application/x-www-form-urlencoded' (CHARACTER)
(0x03000000:NameValue):IdentitySourceType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceToken = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedType = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedToken = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000:Name):HTTPInputHeader = ( ['WSINPHDR' : 0x786aa98]
(0x03000000:NameValue):X-Original-HTTP-Command = 'POST http://localhost:7080/PostSvc HTTP/1.1' (CHARACTER)
(0x03000000:NameValue):Cache-Control = 'no-cache' (CHARACTER)
(0x03000000:NameValue):Pragma = 'no-cache' (CHARACTER)
(0x03000000:NameValue):User-Agent = 'Java/1.5.0' (CHARACTER)
(0x03000000:NameValue):Host = 'localhost:7080' (CHARACTER)
(0x03000000:NameValue):Accept = 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2' (CHARACTER)
(0x03000000:NameValue):Connection = 'keep-alive' (CHARACTER)
(0x03000000:NameValue):Content-Type = 'application/x-www-form-urlencoded' (CHARACTER)
(0x03000000:NameValue):Content-Length = '89' (CHARACTER)
(0x03000000:NameValue):X-Remote-Addr = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Remote-Host = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Server-Name = 'localhost' (CHARACTER)
(0x03000000:NameValue):X-Server-Port = '7080' (CHARACTER)
(0x03000000:NameValue):X-Scheme = 'http' (CHARACTER)
)
(0x01000000:Name):BLOB = ( ['none' : 0x3fe4840]
(0x03000000:NameValue):BLOB = X'3f557365723d616263642650617373776f72643d6162636426496e7075743d253343253346786d6c2b766
57273696f6e253344253232312e302532322b656e636f64696e672533442532325554462d38253232253346253345' (BLOB)
(0x03000000:NameValue):UnknownParserName = '' (CHARACTER)
)
)
( ['MQROOT' : 0x79170b0]
(0x01000000:Name):Destination = (
(0x01000000:Name):HTTP = (
(0x03000000:NameValue):RequestIdentifier = X'414d5120574d42363131514d202020203884504b2000aa04' (BLOB)
)
)
)
=============================================================================
'' from trace node 'MsgFlow.Trace'.
The trace node 'MsgFlow.Trace' has output the specified error message.
This is an error message provided by the message flow designer. The user response will be determined by the local environment.
[edit] for readability[/edit] |
|
Back to top |
|
 |
sridhsri |
Posted: Fri Jan 15, 2010 10:33 am Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
you might want check the service level of the broker in question
mqsiservice <broker-name>
when you apply a fix pack, it doesn't affect existing brokers by default. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jan 15, 2010 11:22 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
I think you need to go back to basics.
- What things are you trying to do? ( get the http message, decode the URL string, decode the XML, parse the XML )
- Which of those things have you done successfully so far?
- What have you done to diagnose the parts that are not yet done?
I would like to see a user trace of your flow. Most of what we need to know would be contained in the user trace. Especially if you leave the Trace node in there and make it write to user trace. |
|
Back to top |
|
 |
mgk |
Posted: Fri Jan 15, 2010 12:17 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1647
|
OK,
I understand what is happening now, thanks to the full trace you posted above. You are sending in:
POST http://localhost:7080/PostSvc HTTP/1.1
with the content-type header of:
Content-Type = 'application/x-www-form-urlencoded'
which is normally from an HTTP form, and the contents is NOT sent as a query string in this case. This is why the "parse query string" option had no affect as there was no query string to parse.
Unfortunately, WMB does not currently parse 'application/x-www-form-urlencoded' data automatically - but you can use java to parse it as you have been doing.
However as you seem to be in control of your Java client you need to change the code to send a GET (as you originally claimed) rather than a POST (which the trace output shows you are sending). Try using the HttpURLConnection setRequestMethod method to use GET. You may also have to set the Content-Type header as well...
Kind Regards _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jan 15, 2010 1:31 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
I expect you also will need to convert this:
Code: |
%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E |
to this
Code: |
<?xml version="1.0" encoding="UTF-8"> |
There's probably a method in some Java library to do it for you. |
|
Back to top |
|
 |
mgk |
Posted: Fri Jan 15, 2010 1:47 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1647
|
I agree with kimbert. However, if you can send the data in as an actual query string, then the "parse query string" option will do exactly the convertion kimbert mentions without needing a java method to do it. It will all be done for you by the HTTP Input node...
Kind Regards _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
broker_new |
Posted: Fri Jan 15, 2010 1:48 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
Thanks mgk, that worked i updated the client code to make the request method to "GET" and Content-Type ..worked well.Thank you
import java.net.*;
import java.io.InputStream;
import java.io.BufferedInputStream;
import java.io.IOException;
public class XmlPost1 {
public XmlPost1() {
}
public static void main(String[] args) {
String url ="http://localhost:7080/PostSvc?User=abcd&Password=abcd&Input=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E";
try
{
URL u = new URL( url);
HttpURLConnection huc = (HttpURLConnection) u.openConnection();
huc.setRequestMethod("GET");
huc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
huc.setDoInput(true);
huc.setDoOutput(false);
huc.setUseCaches(false);
huc.connect();
InputStream inputStream = huc.getInputStream();
BufferedInputStream bis = new BufferedInputStream(inputStream);
while(true)
{
int cint = bis.read();
if(cint == -1)
{
break;
}
System.out.println("\n Webservice XML Response:\n" + (char)cint + "\n");
System.out.print((char)cint);
}
huc.disconnect();
}
catch (IOException e){
System.out.println("Error : "+e);
}
}
} |
|
Back to top |
|
 |
mgk |
Posted: Fri Jan 15, 2010 3:05 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1647
|
That's great, I'm glad it's working. Maybe you could post another full trace to show what the tree is supposed to look like when it has been parsed properly
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
broker_new |
Posted: Fri Jan 15, 2010 6:15 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
Here is the full trace of the working message flow
( BROKER611.default ) Error message
Code: |
''=============================================================================
2010-01-15 16:51:03.815083
( ['WSRoot' : 0x7918418]
(0x01000000:Name):Properties = ( ['WSPROPERTYPARSER' : 0x41024a0]
(0x03000000:NameValue):MessageSet = '' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
(0x03000000:NameValue):Encoding = 546 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 1208 (INTEGER)
(0x03000000:NameValue):Transactional = FALSE (BOOLEAN)
(0x03000000:NameValue):Persistence = FALSE (BOOLEAN)
(0x03000000:NameValue):CreationTime = GMTTIMESTAMP '2010-01-15 21:50:56.980' (GMTTIMESTAMP)
(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):ReplyProtocol = 'SOAP-HTTP' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = 'application/x-www-form-urlencoded' (CHARACTER)
(0x03000000:NameValue):IdentitySourceType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceToken = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedType = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedToken = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000:Name):HTTPInputHeader = ( ['WSINPHDR' : 0x786b8d0]
(0x03000000:NameValue):X-Original-HTTP-Command = 'GET http://localhost:7080/PostSvc HTTP/1.1' (CHARACTER)
(0x03000000:NameValue):Cache-Control = 'no-cache' (CHARACTER)
(0x03000000:NameValue):Pragma = 'no-cache' (CHARACTER)
(0x03000000:NameValue):User-Agent = 'Java/1.5.0' (CHARACTER)
(0x03000000:NameValue):Host = 'localhost:7080' (CHARACTER)
(0x03000000:NameValue):Accept = 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2' (CHARACTER)
(0x03000000:NameValue):Connection = 'keep-alive' (CHARACTER)
(0x03000000:NameValue):Content-Type = 'application/x-www-form-urlencoded' (CHARACTER)
(0x03000000:NameValue):X-Remote-Addr = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Remote-Host = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Server-Name = 'localhost' (CHARACTER)
(0x03000000:NameValue):X-Server-Port = '7080' (CHARACTER)
(0x03000000:NameValue):X-Query-String = 'User=abcd&Password=abcd&Input=Test_WS_MsgFlow.TraceCTest_WS_MsgFlow.TraceFxml
+versionTest_WS_MsgFlow.TraceD%221.0%22+encoding%3D%22UTF-8%22%3F%3E' (CHARACTER)
(0x03000000:NameValue):X-Scheme = 'http' (CHARACTER)
)
(0x01000000:Name):BLOB = ( ['none' : 0x3fe4840]
(0x03000000:NameValue):BLOB = X'557365723d616263640d0a50617373776f72643d616263640d0a496e7075743d253343253346786d6c2b7
6657273696f6e253344253232312e302532322b656e636f64696e672533442532325554462d382532322533
462533450d0a' (BLOB)
(0x03000000:NameValue):UnknownParserName = '' (CHARACTER)
)
)
( ['MQROOT' : 0x7919330]
(0x01000000:Name):Destination = (
(0x01000000:Name):HTTP = (
(0x03000000:NameValue):RequestIdentifier = X'414d5120574d42363131514d202020203884504b2000a30d' (BLOB)
)
)
(0x01000000:Name):HTTP = (
(0x01000000:Name):Input = (
(0x01000000:Name):QueryString = (
(0x03000000:NameValue):User = 'abcd' (CHARACTER)
(0x03000000:NameValue):Password = 'abcd' (CHARACTER)
(0x03000000:NameValue):Input = '<?xml version="1.0" encoding="UTF-8"?>' (CHARACTER)
)
)
)
)
=============================================================================
'' from trace node '%3'.
|
The trace node '%3' has output the specified error message.
This is an error message provided by the message flow designer. The user response will be determined by the local environment. |
|
Back to top |
|
 |
|