Michael Lucas
Michael Lucas

Reputation: 783

invoking JAX-WS web service with array param using GET

I have a CXF JAX-WS web service operation named "diagnosticPing" that accepts two params, an int and a String[] array. From the wsdl:

<xs:element name="depth" type="xs:int"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="instructions" type="xs:string"/>

I'd like to try and invoke this operation from a browser directly, as this would be a useful way to "ping" the service without needing a tool like SoapUI. However, I can't figure out how to construct my query string so that the service will recognize the String[] array param. My best try was something like:

https://hostname/ServiceUri/service/diagnosticPing?depth=2&instructions=%22accountType%3DABC%22,%22action%3DgetDetails%22,%22version%3D1.0%22}

But I received an error like so:

argument type mismatch while invoking public java.util.List ca.gwl.group.account.service.routing.AccountServiceRouter.diagnosticPing(int,java.lang.String[]) with params [2, {"accountType=ABC","action=getDetails","version=1.0"}].

Does anyone have any idea how to invoke the web service with a query string param that will be accepted as a String array?

Upvotes: 0

Views: 874

Answers (1)

Daniel Kulp
Daniel Kulp

Reputation: 14607

Doesn't look like there is a way. If you want to look at it, you can dig into the CXF URIMappingInterceptor. There is a method in there called:

private Object readType(String value, Class type)

that would need to be updated to handle collections and arrays. Patches are welcome.

:-)

Upvotes: 1

Related Questions