Tag: soap

JAXWS和会话

我很擅长编写Web服务。 我正在使用JAXWS开发SOAP服务。 我希望能够让用户登录并在我的服务中知道哪个用户正在发出命令。 换句话说,有一些会话处理。 我见过这样做的一种方法是使用cookie并从我的Web服务访问HTTP层。 但是,这依赖于使用HTTP作为传输层(我知道HTTP几乎总是传输层,但我是纯粹的)。 是否有更好的方法可以使服务层不知道传输层? 有没有办法用servletfilter完成这个? 我希望答案尽可能与框架无关。

架构师迫切希望在JMS上使用SOAP

我过去曾使用JMS来构建应用程序,它运行良好。 现在我与想要使用Spec:SOAP over Java Message Service 1.0的Architects合作。 这个规格过于复杂。 我没有看到很多实现(除了供应商推动规范)。 这里有人在生产环境中使用此规范吗? 使用此规范的主要好处是什么? 链接: http : //www.w3.org/TR/2009/CR-soapjms-20090604/

Java – Spring Ws – 在XSD文件中加载相对包含(Tomcat 8)

我创建了一个Spring Web服务,它使用以下代码从XSD文件集合创建动态WSDL: Resource[] schema = { new ClassPathResource( “schema/service/XCPD.SupportMaterials.v9/schema/HL7V3/NE2008/coreschemas/NarrativeBlock.xsd”), new ClassPathResource( “schema/service/XCPD.SupportMaterials.v9/schema/HL7V3/NE2008/coreschemas/datatypes-base.xsd”), new ClassPathResource( “schema/service/XCPD.SupportMaterials.v9/schema/HL7V3/NE2008/coreschemas/infrastructureRoot.xsd”), new ClassPathResource( “schema/service/XCPD.SupportMaterials.v9/schema/HL7V3/NE2008/multicacheschemas/PRPA_IN201305UV02.xsd”), new ClassPathResource( “schema/service/XCPD.SupportMaterials.v9/schema/HL7V3/NE2008/multicacheschemas/PRPA_IN201306UV02.xsd”), new ClassPathResource( “schema/service/XCPD.SupportMaterials.v9/schema/IHE/XCPD_PLQ.xsd”), new ClassPathResource( “schema/service/XCPD.SupportMaterials.v9/schema/HL7V3/XCPD_PRPA.xsd”) }; CommonsXsdSchemaCollection collection = new CommonsXsdSchemaCollection( schema); collection.setInline(true); return collection; 用于创建动态WSDL的XSD文件包括使用include语句的其他各种模式文件,如下所示: 当我在Tomcat 8容器中运行代码时,我收到以下exception: Caused by: java.lang.IllegalArgumentException: The resource path [/../coreschemas/infrastructureRoot.xsd] has been normalized to [null] which is not […]

在JAX-WS中重命名参数名称

我使用自下而上的方法在RSA 7.5和Websphere 7中使用JAX-WS创建了一个Web服务。 当我在SOAP UI中打开WSDL时,参数部分显示如下: ? ? ? ? service方法将上述4个元素作为参数来返回员工详细信息。 1)我想用一些有效的名称重命名这个arg0,arg1等。 2)我想删除arg标签上方的 。 (为了从元素名称中删除 ,我使用了@XMLElement(required = true))。 但我不确定在这种情况下在哪里使用此注释:( 请帮忙。 问候,

AXIS vs JAX-WS for Web Service Client

我决定用Java实现Web Service Client。 我在Eclipse中生成了Axis客户端,在wsimport中生成了JAS-WS客户端。 这两种解决方案都有效,现在我必须选择一种解决方案。 在选择一个之前我应该​​考虑什么?

SOAP消息到webservice – HTTP响应代码:403用于URL

我尝试将XML文件中的SOAP消息发送到Web服务,然后获取二进制输出并对其进行解码。 端点使用HTTPS协议,因此我在代码中使用了TrustManager来避免PKIX问题。 你可以在这里看到我的代码: import javax.net.ssl.*; import java.io.*; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.security.cert.X509Certificate; public class Main{ public static void sendSoapRequest() throws Exception { String SOAPUrl = “URL HERE”; String xmlFile2Send = “.\\src\\request.xml”; String responseFileName = “.\\src\\response.xml”; String inputLine; TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; […]

wsimport两个声明导致冲突

我想在https://api.sendwordnow.com/webservices/v3/users.svc?wsdl上使用wsimport。 这是我正在使用的wsimport。 wsimport -B-XautoNameResolution -d C:\temp -extension -J-Djavax.xml.accessExternalSchema=all -J-Djavax.xml.accessExternalDTD=all -keep -verbose -XadditionalHeaders -Xnocompile https://api.sendwordnow.com/webservices/v3/users.svc?wsdl 这是错误。 解析WSDL … [WARNING] unknown extensibility element or attribute “EndpointReference” (in namespace “http://www.w3.org/2005/08/addressing”) line 1 of https://api.sendwordnow.com/webservices/v3/users.svc?wsdl [ERROR] Two declarations cause a collision in the ObjectFactory class. line 1 of https://api.sendwordnow.com/webservices/v3/Users.svc?xsd=xsd3 [ERROR] (Related to above error) This is the other declaration. […]

使用相互SSL的SOAP – 如何通过凭据发送?

public class ResLookupGetService extends Service { ServerServicePortType getServerServicePort(); } public interface ServerServicePortType { ServerServiceResponse doSoapMethod(RequestObject request, ParamObject parameters); } ServerServicePortType service = new ServerServiceGetService().getServerServicePort(); ServerServiceResponse response = service.doSoapMethod(request, parameters); 上述代码适用于在需要相互SSL加密之前调用我的SOAP服务。 一旦打开,我尝试创建一个SSL上下文并设置如下: ServerServicePortType service = new ServerServiceGetService().getServerServicePort(); BindingProvider bindingProvider = (BindingProvider) service; bindingProvider.getRequestContext().put( “com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory”, getSslContext().getSocketFactory()); ServerServiceResponse response = service.doSoapMethod(request, parameters); 以及创建SSLContext的代码: public SSLContext getSslContext(String keyStorePath, String […]

WSIT / Metro不了解​​Security SOAP标头

我正在使用WSIT / Metro来创建一个简单的Web服务。 当客户端尝试使用简单的用户名/ passowrd身份validation方案连接时,我在服务器上收到以下错误: 2010.03.31. 19:10:33 com.sun.xml.ws.protocol.soap.MUTube getMisUnderstoodHeaders INFO: Element not understood={http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security 我不知道如何让WSIT理解安全块。 我从客户那里得到的请求: admin admin http://localhost:11122/services/TopJtapiRemoteMethods urn:uuid:D5C576F83D74F761311270055433217 urn:hasCallPolling 服务器的WSDL: 我的代码,设置服务器: import java.io.InputStream; import java.util.Collections; import javax.jws.WebService; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import javax.xml.ws.Endpoint; import javax.xml.ws.Holder; import com.topdesk.cti.topjtapi.soapserver2.HasCallPollingResponse; import com.topdesk.cti.topjtapi.soapserver2.TopJtapiRemoteMethodsPortType; public class EndpointTester { @WebService(endpointInterface = “com.topdesk.cti.topjtapi.soapserver2.TopJtapiRemoteMethodsPortType”) private static final class MockImplementation implements TopJtapiRemoteMethodsPortType { […]

Android上的XML SOAP签名

我需要在Android应用程序中签署XML SOAP请求。 我做了一些研究,似乎没有框架可以在Android上做到这一点。 有没有人设法做到这一点?