Https Receive Error

Platform:- webMethods Integration Server 6.0.1 on HPUX

Currently I have a service to receive xml via https from a
user ( xmlNodeToDocument etc. ) and immediately route to TN.

One type of document they send works correctly. The other
types fail.

With one failer I receive a string variable $xmldata that is empty,
with others I receive nothing.

They get :-
500 Error performing Post: vtHttpConnectorEvents.HttpException

Etract from server log :-

2007-01-15 18:21:01 GMT [ISP.0090.0001I] — START tracePipeline [1/15/07 6:21 PM] —
2007-01-15 18:21:01 GMT [ISP.0090.0008I] 0 level {java.lang.String} = ‘3’
2007-01-15 18:21:01 GMT [ISP.0090.0008I] 0 node {com.wm.lang.xml.Document} = ‘DOCUMENT System ID: null Public ID: null’
2007-01-15 18:21:01 GMT [ISP.0090.0002I] — END tracePipeline —
2007-01-15 18:21:01 GMT [ISC.0076.0007W] XMLCoder decode invalid data type: com.wm.lang.xml.Document
2007-01-15 18:21:01 GMT [ISU.0000.9999W] BizDocTypeReg: ERROR invoking recognize for 10k09n00vevog2g2000000ci [TRNSERV.000019.000036]
2007-01-15 18:21:01 GMT [ISU.0000.9999W] com.wm.app.tn.doc.CorruptXMLException: There was an error in trying to get XML header information (DOCTYPE and DTD).
The document (10k0hs0v20jfr9i0000001v0) is probably not valid XML.

I suspect there is a problem with their xml.

What I am looking for is tip as to how I start a service to receive their data (not as xml) so I can capture a copy.
How should capture their data, what should my input be.

I have tried a service which has a string input.
The first line of data should be <?xml version="1.0" standalone="no"?>

In testing (restorePipelineFromFile ) I get a string variable
created called ‘<?xml version’ which is the start of the xml, and the value contains the rest of the xml.

I also get a string list named ‘<?xml version List’

Any suggestions.

Thanks … john

Wild Guess Department: Is the sender setting the content-type to “Text/XML”?

Thank you for the reply Mark.

That was one of my concerns, but overnight I received a copy of the xml document in an email and content type seems ok.

Would the size of the document make any different. The failing documents
are 2,100 lines approx.

…john

The HTTP header property “content-type” is used to tell Integration Server how to treat the contents of a HTTP post. If you post a valid XML document with the wrong content-type IS may treat it as HTML conent (which might result in the XML version declaration being treated as a name-value pair).

In order to send XML to IS by HTTP/S or FTP or Email, the sender must set the content-type to “text/xml”.

One way to verify the content-type that was used to send a document is to add a pub.flow:getTransportInfo service call as the first line of your Flow service and then output the contents of the transport/http/requestHdrs variable using debugLog. requestHdrs is an array, so you may need to loop over it to get to content-type.

HTH,

Mark

Thank you Mark,

I will try the changes and retest, which takes a while as the users are US based, and we are UK based, time difference really gets in the way.

Thanks again … john

Hello John,

Can you help me in configuring a HTTPS port. My requirement is similar to yours, in which a client applicaiton is sending XML docs to a HTTPS URL location.

What I am not getting is, how to write a service to pick up those XML from the URL and process it. Any help from you will be appreciated.

Thanks for your efforts John.

johnrose,

Configure the port through the Administrator console under Security -> Ports. You’ll need the location of the certificates you’ll be using for HTTPS.

For the service, create a quick and dirty flow service.

Start with an Object called node as the input (this is not really required, but helps make things clearer.) In the code area of the flow service, insert pub.xml:xmlNodeToDocument. Then insert pub.xml:documentToXMLString. Then insert a debugLog statement and map the string xmldata (output from documentToXMLString) to message (input on debugLog). No other mapping is really necessary, due to implicit mapping.

Test by sending an XML document to http://:/invoke/servicenamespace:servicename. If it works, you should see the XML document you sent to the IS appear in the server.log.

You can then replace the documentToXMLString and debugLog steps with whatever real logic you intend to implement.

Hi Phil,

Thanks for your prompt response.

I configured a HTTP port on my local IS (Not HTTPS). I have used the following flow services as suggested by you.

  1. Take a Node Object as input
  2. pub.xml:xmlNodeToDocument
  3. pub.xml:documentToXMLString
  4. pub.flow:debugLog

I am getting the following error:
com.wm.app.b2b.server.ServiceException: java.lang.ClassCastException

I am using pub.client:http service to test the above flow service. I am passing the URL, method as POST, load as BYTES, and I am pasting the content of the XML file in the String field of the HTTP service. I am also setting the content-type as “Text/XML”

I am not sure whether that it is the right way of testing the flow service. Can you tell me any other method of doing the testing or Is it my flow service is not correct.

Thanks,
Johnrose.

There are many ways to skin this cat, but here’s my favorite:

in your existing HTTP service, add a string called $xmldata under the data/args document (make sure it is indented underneath). Map your XML file content to data/args/$xmldata. Send.

Hi Phil,

Thanks for your gr8 suggestion. IT worked!!!:lol:

Now my only concern is how to configure the HTTPS port. I went through many documentation asked many guyz, but I am still as confused as I was before when I started. Please can you tell me the steps of how to do this.

My client is an Siebel Application which sends XML data to an URL location. webMethods is supposed to listed to this URL and pick up the XML’s and process it.

Thanks again Phil for your contributions…

To start with, you will need three certificates: 1) your server’s public, 2) your server’s private key, and 3) the certifying authorities key (whichever CA signed your public cert)

If you don’t have those, talk to your security administrator.

If you do have them, do the following (there are other ways to do this as well, but this is the most straightforward way):

  1. Copy the three certificates to a location under your webMethods directory. Many people place them under /webMethods/IntegrationServer/config/certs.
  2. In the IS Administrator console, under Security -> Ports, click Add Port
  3. Choose webMethods/HTTPS
  4. Specify the PORT number (typically 443)
  5. Choose a package to bind to the port (this means if the package is disabled, the port will be disabled, if the package is published, the port will go with it.)
  6. Bind address is only used if you have more than one IP - by default, the IS listens on all.
  7. Under the Listener Specific Credentials, put the location and name of the three certificates above. Specify them relative to the IS directory, for example config/certs/myServerCert.der.
  8. Declare a trusted authority directory, such as config/trusted (this is a directory that will hold the certificates of certifying authorities whom you trust). Do NOT leave this blank, do NOT list a directory that does not exist, and do NOT list a directory that does not have at least one certificate in it.
  9. Save changes.
  10. Set the Access Mode for the port.
  11. Enable the port.

Some additional information:

  • Your security administrator may want you to use a keystore. If so, the above will need to be altered to match that store.
  • If you are going to use the same certificates for many HTTPS ports (rather than one), you can configure the certificates once under Security -> Certificates, and then leave the certificates area blank when adding an HTTPS port.
  • If you need certificates for the common trusted authorities to put in your trusted authority directory, you can export some of the ones that come with Internet Explorer (in IE7, under Tools -> Internet Options, then the Content tab. Look for a Certificates button. It would be better to wait until you know what your partners will use to determine who to trust, however.

More information of course in the Administrators guide as well.

Thanks Phil,

I will try to configure the same and will get back to you with the updates.