83186

webservice annotation issues with soapui

Question:

My manager gave me a wsdl url to me today,and he want to publish a same wsdl on our side,i met an issue while combine the annotation request with spring,can someone help ?The custom request following:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:door="http://www.derbysoft.com/doorway"> <soapenv:Header/> <soapenv:Body> <door:PingRequest Token="?" UserName="?" Password="?" Echo="?"/> </soapenv:Body> </soapenv:Envelope>

what i can generated like following:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:door="http://www.test.com/doorway"> <soapenv:Header/> <soapenv:Body> <door:PingRequest> <PingRequest Echo="?" Token="?" UserName="?" Password="?"/> </door:PingRequest> </soapenv:Body> </soapenv:Envelope>

It always contain more element with method name,how i can remove that ?I attached my source here.

@WebService(name="Example", targetNamespace="http://www.test.com/doorway", serviceName="Example") @SOAPBinding(style=SOAPBinding.Style.RPC) @XmlAccessorType(XmlAccessType.NONE) public class Example { @WebMethod(operationName="toSayHello",action="sayHello",exclude=false) public String sayHello(@WebParam(name="userName")String userName) { return "Hello:" + userName; } @WebMethod() public void PingRequest(@WebParam(name="PingRequest")PingRequest pingRequest) { }

}

Entity:

@XmlAccessorType(XmlAccessType.NONE) public class PingRequest { @XmlAttribute(name="Echo") private String echo; @XmlAttribute(name="Token") private String token; @XmlAttribute(name="UserName") private String userName; @XmlAttribute(name="Password") private String password; public String getToken() { return token; } public void setToken(String token) { this.token = token; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEcho() { return echo; } public void setEcho(String echo) { this.echo = echo; }

}

Many thanks in advance !!

Kind Regards, James

Answer1:

I have find the way to do this,us wsimport tool to do this,this will generate all the entity class and webservice annotation info,also the annotation for this case should like this:@SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE)

Recommend

  • How to access serial port from two different application in c#
  • IDX10503: Signature validation failed
  • oauth2client.client.HttpAccessTokenRefreshError: invalid_grant: Invalid JWT
  • Syntax error near unexpected token 'elif'
  • read values from form post in jquery or javascript
  • Why the SequenceFile is truncated?
  • Looking for good analogy/examples for monitor verses semaphore
  • saving file generated by TCPDF
  • revitapi ironpython ToRoom returns “indexer # object”
  • How to view images from protected folder with php?
  • Alternative To body {overflow:scroll;} That Will Prevent Page Jostling/Wriggling?
  • Textfile Structure (tables)
  • MongoError: Incorrect arguments
  • Play WS (2.2.1): post/put large request
  • Django rest serializer Breaks when data exists
  • Optimizing database types to compact database (SQLite)
  • How to redirect a user to a different server and include HTTP basic authentication credentials?
  • Cross-Platform Protobuf Serialization
  • vba code to select only visible cells in specific column except heading
  • Do I've to free mysql result after storing it?
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • Codeigniter doesn't let me update entry, because some fields must be unique
  • Free memory of cv::Mat loaded using FileStorage API
  • Getting error when using KSoap library to consume .NET web services
  • Trying to get generic when generic is not available
  • Getting Messege Twice Using IMvxMessenger
  • Change div Background jquery
  • Turn off referential integrity in Derby? is it possible?
  • How to get Windows thread pool to call class member function?
  • Authorize attributes not working in MVC 4
  • Bitwise OR returns boolean when one of operands is nil
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Easiest way to encapsulate a HTML5 webpage into an android app?
  • Busy indicator not showing up in wpf window [duplicate]
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS
  • Conditional In-Line CSS for IE and Others?