好的n00b在这里使用SOAP,
想要对如何使用SOAP进行一些澄清.
题:
我有一个Java JSP,它将WSDL(看起来像XML格式)发布到我的PHP脚本中,但是如何在PHP脚本中获得它?WSDL的URL每次都会有所不同.
我确定这很简单,但是我看不出我是怎么理解这个?
我正在使用 WCF 在 C# 中进行一些 wsdl 和客户端优先开发(wsdl 和客户端已经存在,我正在构建服务器端,)并且我遇到了一个奇怪的问题。我使用 wsdl.exe 从我的 .wsdl 生成合同,我能够构建它并将 WCF 服务作为 Windows 服务托管。
但是,我从http://localhost/Service?wsdl 获得的 wsdl公开了私有字段而不是公共属性(例如:而不是OsTypeI get m_OsTypeField,这是与公共OsType属性关联的私有变量。)
以下是有此问题的类之一的属性:
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://xxxxxxx.com/")]
我完全被难住了,因为 .NET XML 序列化程序应该忽略任何私有成员。关于为什么会发生这种情况的任何想法?
背景: 我正在构建一个每天运行的小应用程序,从我们自己的内部数据库中提取数据并将其发送到我们的公司Salesforce实例.我在Salesforce实例中构建了一个自定义对象(称为Marqui_Instance)来存放数据.该应用程序将创建几百个,并将它们附加到各种帐户记录.
问题: 我们的Salesforce实例是专业版,这意味着我无法为我们的实例生成WSDL,这让我觉得我无法开发可以创建/编辑/删除Marqui_Instance对象的代码.
在我开始在黑暗中挣扎之前,我想我会在这里发帖寻求建议.我唯一能想到的是在Salesforce开发人员帐户中创建一个相同的对象,并从那里使用WSDL ......但是当我在生产中部署代码时,它会起作用吗?我很害怕我的开发帐户中的WSDL会有一些guid或类似的东西,我的代码只会对开发帐户起作用.
我正在尝试使用 Eclipse(新 Web 服务客户端)生成 Java 类。
Eclipse 抛出此异常:
Error in generating Java from WSDL: java.lang.IllegalArgumentException: Duplicate operation with name=OpName, found in portType '{http://tempuri.org/}MyServiceSoap'.
在 WSDL 中:
<wsdl:operation name="OpName">
<wsdl:input message="tns:tnsIn"/>
<wsdl:output message="tns:tnsOut"/>
</wsdl:operation>
<wsdl:operation name="OpName">
<wsdl:input name="name" message="tns:tnsIn"/><wsdl:output name="name" message="tns:tnsOut"/></wsdl:operation>
我该如何解决这个问题?您能否建议任何其他工具或开发环境来根据 WSDL 生成类?
有人可以解释这实际意味着什么吗?一个例子真的很有帮助.
WS-I:(BP2012)文档 - 文字绑定包含soapbind:body元素,它们引用没有element属性的消息部分元素.
在wsdl文件中:如果space在设置 an 的值时存在a会出错attribute吗?例如 :
<soap:address location="http://192.168.1.123/imfmobile/webservice/InterfaceTransfererClient.php"/>
Run Code Online (Sandbox Code Playgroud)
如果我写的是错误:
<soap:address location = "http://192.168.1.123/imfmobile/webservice/InterfaceTransfererClient.php"/>
Run Code Online (Sandbox Code Playgroud)
或者
<soap:address location= "http://192.168.1.123/imfmobile/webservice/InterfaceTransfererClient.php"/>
Run Code Online (Sandbox Code Playgroud)
或者
<soap:address location ="http://192.168.1.123/imfmobile/webservice/InterfaceTransfererClient.php"/>
Run Code Online (Sandbox Code Playgroud) 我正在尝试访问我正在处理的项目的Web服务.我正在使用JAX-WS,应用程序部署在weblogic上.当我试图访问WS时,我得到以下异常:
javax.portlet.PortletException: javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://xxx.xxxx.ro:40000/idm/ws/cup?wsdl. It failed with:
Response: '401: Unauthorized' for url: 'http://xxx.xxxx.ro:40000/idm/ws/cup?wsdl'.
at com.bea.portlet.container.PortletStub.processAction(PortletStub.java:346)
at com.bea.portlet.container.AppContainer.invokeProcessAction(AppContainer.java:678)
........
Run Code Online (Sandbox Code Playgroud)
我阅读了很多关于问题的帖子,我尝试了不同类型的auth.我尝试在不同的用例中使用BindingProvider,basicHTTPAuth,禁用HostnameVerifier等但仍然没有结果.
以下是我的代码片段,作为最后一个尝试过的版本:
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
username,
password.toCharArray());
}
});
ComputeUserProfileImplService computeUserProfileImplService = new ComputeUserProfileImplService(
new URL(null, endpointURL, new sun.net.www.protocol.http.Handler()),
new QName("http://xxx.xx.xxxxx.xxxxx.com/",
"ComputeUserProfileImplService"));
ComputeUserProfileImpl computeUserProfile = computeUserProfileImplService
.getComputeUserProfileImplPort();
Run Code Online (Sandbox Code Playgroud)
ComputeUserProfileImplService代码如下所示:
private final static URL COMPUTEUSERPROFILEIMPLSERVICE_WSDL_LOCATION;
private final static Logger logger = Logger.getLogger(com.xxxxx.xxxxx.xx.xxxxx.cup.ComputeUserProfileImplService.class.getName());
static {
URL url = null;
try { …Run Code Online (Sandbox Code Playgroud) 这不是Java特有的问题,但让我们在Java中有一个例子:Java世界中的一个标准做法是添加xmime:expectedContentTypes="*/*到base64元素以在服务器端启用MTOM处理 - 它导致@XmlMimeType注释,使用DataHandlers代替字节虽然这种描述当然大大简化了,但是xmime:expectedContentTypes="*/*当在模式中看到时,通常被开发人员(更重要的是也通过实现库)识别为"MTOM就绪".从我从示例中收集的内容来看,C#世界的情况是一样的.
然而,它确实对我没有意义 - 该属性指定了我们可能在XML中实际期望的数据类型,而不是它可以与MTOM一起使用.我还没有在SOAP 1.1的任何RFC或类似文档中找到预期内容类型和MTOM之间的任何直接连接.
我的问题可以用两种方式表达:
我正在尝试使用插件jaxb2-maven-plugin从wsdl创建Java类。
我使用1.5版和以下代码(链接:从WSDL使用jaxb2-maven-plugin生成类)获得了它:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Package to store the generated file -->
<packageName>com.example.demo.wsdl</packageName>
<!-- Treat the input as WSDL -->
<wsdl>true</wsdl>
<!-- Input is not XML schema -->
<xmlschema>false</xmlschema>
<!-- The WSDL file that you saved earlier -->
<schemaFiles>horarios.wsdl</schemaFiles>
<!-- The location of the WSDL file -->
<schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
<!-- The output directory to store the generated Java files -->
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<!-- Don't clear output directory …Run Code Online (Sandbox Code Playgroud)