Failed Pass Parameter to Web Service in Mule - web-services

I call the Operation from SOAP using Web Service Consumer component, and I want to pass the parameter using Transform Message.
Show Image
I set Java Class in Transform Message, and declared the parameter.
Show Image
When I run the app, I get error.
This is the error :
Message : Could not find a transformer to transform "SimpleDataType{type=java.util.LinkedHashMap, mimeType='/', encoding='null'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='/', encoding='null'}".
Type : org.mule.api.transformer.TransformerException
Code : MULE_ERROR-236
How can I pass the parameter ?
Thanks

I checked one of my SOAP connections where I use Dataweave, and the output type is "application/xml". Can you try using that instead of "application/java"? Also, you may want to define the XMLNS namespace using the Dataweave namespace directive.
https://docs.mulesoft.com/mule-user-guide/v/3.7/dataweave-reference-documentation#namespace-directive

You can read this tutorial for more information about transformer message:
https://docs.mulesoft.com/mule-user-guide/v/3.6/xmlobject-transformers
Best Regards,
Giuseppe.

Related

WSO2 Enterprise Integrator registry value returned in base64

My dev conf : Win2010, WSO2 EI 6.4.0, linux for data store.
I defined a registry entry, named "sourcefileURI" for storing source filepath. The media type I chose is "text/plain" and I store a path like : "/home/wso2/data/in"
When accessing this registry value from a inbound endpoint vfs config, I'm using the following code :
<parameter key="conf:/repository/transports/vfs/telco1/sourcefileURI" name="transport.vfs.FileURI"/>
This is working - almost - fine. I mean the value is returned but in base64.
I was expecting, since I chose media = "text/plain", to have the normal string returned.
The string is well returne - in plain text and not encoded - when I swap media to nothing/void. But this is not something I want to last in my project.
Can you please tell me what I'm doing wrong / don't understand here ?
Many thanks for your help.
1).Check the message builder and formatter you are using in conf/axis2.xml.Try to change the message builder and formatter for text/plain.
2) Otherwise simple solution is to use the xpath function base64Decode(string encodedValue).
3) Otherwise Use script mediator to decode the string or use class mediator.
4) Otherwise use the following link https://ajanthane.blogspot.com/2017/05/accessing-modifying-payload-in.html, in which explains how to create a custom synapse handlers.

SOAP:1.027 SRT: Serialization / Deserialization failed in ABAP Proxy

I have to create a consumer proxy in SAP, the proxy generation is OK (or no errors were reported), but when i tried yo consume the proxy (SE80), i have the next error:
SOAP:1.027 SRT: Serialization / Deserialization failed
System expected a value for the type g.
If i continue, i have the response, but when i tried to call the customer service in a report, i have the error and i can't continue.
In a report, when i tried yo consume the proxy using this code, i have the same error, and i don't have response:
CREATE OBJECT proxy
EXPORTING
logical_port_name = 'LOGICAL_01'.
CALL METHOD proxy->proccess_check_status_invoice
EXPORTING
process_check_status_invoice = input
IMPORTING
process_check_status_invoice_r = output.
Whow can i solve this error?
Thanks,
Please use srt_util and verify the execution error with a trace of that proxy. The error log will specify which field and values are not allowed during the transformation.
SOAP:1.027 SRT: Serialization / Deserialization failed errors are due to incompatible data types, in my experience, most of the times are dates since ABAP datum and the standard differ and must be transformed.
Type g is usually the constant for the TYPEKIND of STRING. My guess is you are binding values that are CHARs instead of the STRING datatype.

ws:outbound-gateway custom interceptor with message header

I am using ws:outbound-gateway to invoke soap service. I have added interceptor as well.
<int-ws:outbound-gateway id="wsOutboundGateway"
request-channel="requestChannel"
uri="{soapURI}"
message-sender="httpMessageSender"
message-factory="messageFactory"
interceptor="myInterceptor"
marshaller="jaxbMarshaller" unmarshaller="jaxbMarshaller">
<int-ws:uri-variable name="soapURI" expression="headers.soapURI"/>
</int-ws:outbound-gateway>
myInterceptor is a class which implements ClientInterceptor.
Query: I have the information in message header which needs to be intercepted. Is there any way to receive the message header in the interceptor.
Note : I am setting the header value in thread local and getting back in the interceptor now.
Any better solution, please suggest.
It depends of the premise and context.
Sorry, but you have to share more info. What is the header? What do you do with that? Maybe there is no need to intercept it in the ClientInterceptor, but would be better even before <int-ws:outbound-gateway>?
UPDATE
I have the info in message header where I have to pass it in the soap header.
Actually ClientInterceptor is fully for different purpose and its intention do not modify the message.
There is WebServiceMessageCallback abstraction for message modification before sending.
But having your requirements like pass SOAP header I can suggest you to take a look into out-of-the-box component like DefaultSoapHeaderMapper. Its populateStandardHeaders deal only with SoapAction and populateUserDefinedHeader populates only as soapHeader.addAttribute(). So, consider some extension of that class to insert custom tags into soapHeader. And already without any ThreadLocal hacks.

Method notesservicev1.exportNotes can not be reflected

We have consumed a third party web service and are trying to invoke it from an winform application. However when I instantiate the web service the following System.InvalidOperationException exception is thrown:
System.InvalidOperationException was unhandled
Method notesservicev1.exportNotes can not be reflected.
The XML element 'GetNotesInfoRequest' from namespace
'http://www.excelacom.com/century/cm/notes/service/webservice/request/v1'
references a method and a type.
Change the method's message name using WebMethodAttribute or change the
type's root element using the XmlRootAttribute.
I got a link:
Method 'XYZ' cannot be reflected
But I am not getting what exactly I should do ?
After checking the above link I get the solution.
GetNotesInfoRequest is used by two Web Service methods as there RequestElementName. That's why I was getting the ambiguity.
Thanks :)

Complex Object in JAX-WS is created empty

I'm testing JAX-WS to access the Oracle IRM web serviecs. I can get it to work just fine with AXIS so this isn't an Oracle problem.
What's happening is that I'm getting the following error when making the call:
Expected xsd:anyType - unknown type provided
If I look at the SOAP packet is sent I see that the owner tag is blank under JAX-WS:
<ns1:browseAccounts>
<owner/>
<accountType>All</accountType>
</ns1:browseAccounts>
The same piece under AXIS is this:
<owner xsi:type="ns1:LicenseServer"
xmlns=""
xmlns:ns1="http://www.sealedmedia.com/ls/server/schema">
<serverKey>#############</serverKey>
</owner>
Obviously the owner tag is not getting properly created, this is what I'm using to create that:
AccountServicesPort AA = ORI.getAccountServices();
LicenseServer LicSer = new LicenseServer();
LicSer.setServerKey("#######################");
List<Account> Acts = AA.browseAccounts(LicSer,AccountAccountType.ALL);
Is there some other process that I need to go through to create the object properly?
EDIT
I thought maybe running the LicenseServer creation through ObjectFactory would help. Unfortunately, it doesn't.
Despite the Oracle IRM documentation stating that BrowseAccounts accepts either a LicenseServer object or a Context object for the owner parameter it actually accepts an LicenseServer_ref.
EDIT
Further, I was running JAX-WS under JDK 1.6.0 which is a lower version than JDK 1.6.0_14. The new version supports XMLSeeAlso annotation which allowed JAX-WS to use the proper class for serialization.