WSD Consumer for webservice with base64Binary

We need to consume a webservice in WM 7.1.3. There is a field of type Base64Binary in one of the operations for sending files . When i create a WSD consumer in webMethods with wsdl, i can see a field with the same type created in the document types of the connectors inputs.

Now when i try to invoke the consumer by supplying the file data (using the pub.string:base64Decode on a base64 encoded string representation of a file), i get an error saying that the field “fieldName” is absent. I can see the bytes object created in the pipeline when i trace the service, but i keep getting this error on invoking the webservice consumer.

It appears that webMethods is unable to convert the byte object (returned by “pub.String:Base64Decode”) to a String field having base constraint of type [base64Binary {XML Schema}] . Is there a way about this ?

did you try to just use the base64-encoded string in this field?

Another option might a String2ByteArray-conversion without decoding the base64-encoded string.

Can you describe this step a bit more in detail?

Regards,
Holger

The first step worked (passing thee base64 encoded string directly to the webservice)!

However, i fail to understand that. This is my understanding: A file can be sent either as bytes or by encoding into a String (base64). My WM service is receiving a file as a string (BAse64 encoded), and then is attempting to pass the same file as bytes to another SOAP webservice. Hence, i used Base64Decode to decode the file String and convert it into an array of bytes which in turn i would pass to the webservice (the corresponding field for byte being Base64Binary. This is what i think should be and should work, but isnt.

Now what is working is this: My flow service is receiving the encoded String and sending it as is to the webservice which is accepting the file as byte. This, according to me should not work, but is working.

My best guess is that Apache Axis is decoding the Base64 string before sending the SOAP on the wire.

PS: The webservice that accepts the file as bytes is implemented in Java and deployed to a JBoss server. The actual input paramater of the operation is a byte but when the service is deployed , the WSDL shows the field as being of type Base64Binary.

Thanks!