0

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?

1
  • Note that it's just a one-dimension String array, i.e. a java.lang.String[] Commented Oct 27, 2011 at 20:02

1 Answer 1

1

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.

:-)

Sign up to request clarification or add additional context in comments.

1 Comment

Could it also be done by creating a custom interceptor and inserting it into the chain at the necessary point? This might be a nice way to include and test this functionality in my business app without having to patch CXF, though I'd be happy to contribute the patch afterwards. But I'm not sure how feasible a custom interceptor is for solving this (only done basic stuff with CXF).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.