longkai / lab

广西大学 - 雨无声实验室开放平台
4 stars 6 forks source link

Message 94 Could not find schema information for the element 'http://www.w3.org/2006/05/addressing/wsdl:UsingAddressing'. D:\Documents\Visual Studio 2008\WebSites\WCFService1\App_WebReferences\ServiceReference3\Service.wsdl 105 10 D:\...\WCFService1\ #25

Open neemo26 opened 10 years ago

neemo26 commented 10 years ago

' NOTE: If you change the class name "Service" here, you must also update the reference to "Service" in Web.config and in the associated .svc file. Public Class Service Implements IService

Public Sub New()
End Sub

Public Function GetData(ByVal value As Integer) As String Implements IService.GetData
    Return String.Format("You entered: {0}", value)
End Function

Public Function GetDataUsingDataContract(ByVal composite As CompositeType) As CompositeType Implements IService.GetDataUsingDataContract
    If composite.BoolValue Then
        composite.StringValue = (composite.StringValue & "Suffix")
    End If
    Return composite
End Function

End Class

neemo26 commented 10 years ago

' NOTE: If you change the interface name "IService" here, you must also update the reference to "IService" in Web.config. <ServiceContract()> _ Public Interface IService

<OperationContract()> _
Function GetData(ByVal value As Integer) As String

<OperationContract()> _
Function GetDataUsingDataContract(ByVal composite As CompositeType) As CompositeType

' TODO: Add your service operations here

End Interface

' Use a data contract as illustrated in the sample below to add composite types to service operations. <DataContract()> _ Public Class CompositeType

Private boolValueField As Boolean
Private stringValueField As String

<DataMember()> _
Public Property BoolValue() As Boolean
    Get
        Return Me.boolValueField
    End Get
    Set(ByVal value As Boolean)
        Me.boolValueField = value
    End Set
End Property

<DataMember()> _
Public Property StringValue() As String
    Get
        Return Me.stringValueField
    End Get
    Set(ByVal value As String)
        Me.stringValueField = value
    End Set
End Property

End Class

neemo26 commented 10 years ago

Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.ComponentModel

Public Interface Interface1

End Interface

neemo26 commented 10 years ago

@Test @Rollback(false) public void testTotal() throws Exception { long total = authService.total(); assertEquals(TOTAL, total); }

@Test
@Rollback(false)
public void testList() throws Exception {
    L.debug("id={}", id);
    List<AuthorizedUser> users = authService.users(AuthService.LATEST, (int) id);
    for (AuthorizedUser u : users) {
        L.debug("uid: {}, name: {}", u.getId(), u.getAuthorizedName());
    }

    users = authService.users(AuthService.BLOCKED, (int) id);
    for (AuthorizedUser u : users) {
        L.debug("uid: {}, name: {}", u.getId(), u.getAuthorizedName());
    }

    users = authService.users(AuthService.ALL, (int) id);
    for (AuthorizedUser u : users) {
        L.debug("uid: {}, name: {}", u.getId(), u.getAuthorizedName());
    }
}
neemo26 commented 10 years ago

Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. ' <System.Web.Script.Services.ScriptService()> <WebService(Namespace:="http://tempuri.org/")> <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile11)> <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class WebService Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function HelloWorld() As String
    Return "Hello World"
End Function

End Class

neemo26 commented 10 years ago

@Test @Rollback(false) public void testList2() throws Exception { L.debug("id={}", id); List users = authService.users(AuthService.LATEST, (int) id, true, id); for (AuthorizedUser u : users) { L.debug("uid: {}, name: {}", u.getId(), u.getAuthorizedName()); } users = authService.users(AuthService.LATEST, (int) id, false, id); for (AuthorizedUser u : users) { L.debug("uid: {}, name: {}", u.getId(), u.getAuthorizedName()); }

    users = authService.users(AuthService.BLOCKED, (int) id, true, id);
    for (AuthorizedUser u : users) {
        L.debug("uid: {}, name: {}", u.getId(), u.getAuthorizedName());
    }

    users = authService.users(AuthService.BLOCKED, (int) id, false, id);
    for (AuthorizedUser u : users) {
        L.debug("uid: {}, name: {}", u.getId(), u.getAuthorizedName());
    }

    users = authService.users(AuthService.ALL, (int) id, true, id);
    for (AuthorizedUser u : users) {
        L.debug("uid: {}, name: {}", u.getId(), u.getAuthorizedName());
    }

    users = authService.users(AuthService.ALL, (int) id, false, id);
    for (AuthorizedUser u : users) {
        L.debug("uid: {}, name: {}", u.getId(), u.getAuthorizedName());
    }
}
neemo26 commented 10 years ago
``` ```
neemo26 commented 10 years ago

<?xml version="1.0" encoding="utf-8" ?>

neemo26 commented 10 years ago

<?xml version="1.0" encoding="utf-8" ?>